package cn.youth996.spring.cloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author Zhan Xinjian
 * @date 2021/3/5
 */
@RestController
@Slf4j
public class OrderController {
    private static final String PAYMENT_URL = "http://provider-consul-payment";
    @Resource
    private RestTemplate restTemplate;


    @GetMapping("/consumer/payment/consul")
    public String getPaymentById() {
        return restTemplate.getForObject(PAYMENT_URL + "/payment/consul", String.class);

    }
}
